package com.lcz.demo.jsonplaceholder;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = "jsonplaceholder",url = "http://jsonplaceholder.typicode.com/")
public interface JSONPlaceHolderClient {
    //定义接口的抽象get方法
    @GetMapping("/posts")
    List<Post> getPosts();
    @GetMapping("posts/{postId}")
    Post getPost(@PathVariable("postId")Integer postId);
}
